package com.qf.controller;

import cn.dsna.util.images.ValidateCode;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/code")
public class CodeController extends BaseServlet{
    public void createCode(HttpServletRequest request, HttpServletResponse response) throws IOException {
        ValidateCode validateCode = new ValidateCode(100, 30, 4, 10);
        String code = validateCode.getCode();
        request.getSession().setAttribute("code",code);
        validateCode.write(response.getOutputStream());

    }
}
